package com.example.zuo.mysuperwidgetdemo.ui.imageviewplay;

import com.example.zuo.mysuperwidgetdemo.R;
import com.example.zuo.mysuperwidgetdemo.ui.base.BaseNewActivity;
import com.example.zuo.mysuperwidgetdemo.utils.GlideImageLoader;
import com.youth.banner.Banner;
import com.youth.banner.BannerConfig;

import java.util.ArrayList;
import java.util.List;

public class ImageviewActivity extends BaseNewActivity {
    private Banner banner;
    private List<String> images = new ArrayList<>();

    @Override
    protected int bindLayout() {
        return R.layout.activity_imageview;
    }

    @Override
    protected void bindId() {
        banner = getView(R.id.banner);
    }

    @Override
    protected void init() {
        images.add("http://oih2g7nqy.bkt.clouddn.com/tuijian07.png");
        images.add("https://productpicture.cuican520.com/12031_00.png");
        images.add("https://productpicture.cuican520.com/Curel_10231_00.png");

        //设置图片加载器
        banner.setImageLoader(new GlideImageLoader());
        //设置图片集合
        banner.setImages(images);
        //设置为不轮播 ，默认为轮播
        banner.isAutoPlay(false);
        //显示数字指示器
        banner.setBannerStyle(BannerConfig.NUM_INDICATOR);
        //banner设置方法全部调用完毕时最后调用
        banner.onPageSelected(2);
        banner.start();


    }

    @Override
    protected void setListener() {

    }
}
